﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using SharedCongkak;

namespace Congkak
{
    public class SeedQueue
    {
        Queue<Seed> seeds = new Queue<Seed>();

        const int xOffset = 200;
        const int yOffset = 500;
        const int horSpacing = 60;
        public SeedQueue()
        {
        }

        public Seed Pop()
        {
            Seed seed = seeds.Dequeue();
            return seed;           
            
        }

        public int NoOfSeeds
        {
            get
            {
                return seeds.Count;
            }
        }

        public void Add(Seed seed)
        {
            seed.Position = new Vector2(xOffset + seeds.Count * horSpacing, yOffset);
            seeds.Enqueue(seed);
        }

        public void Draw(SpriteBatch spritebatch)
        {
            foreach(var seed in seeds)
            {
                seed.Draw(spritebatch);
            }
        }
    }
}
